Golang - 條件式與迴圈



if-else

if condition {
    ...
} else {
    ...
}

switch

switch condition {
case c1:
    ...
case c2:
    ...
default:
    ...
}

for

for i := 0; i < count; i++ {
    ...
}

while

for {
    ...
}
#golang #GO







你可能感興趣的文章

C# 文字檔讀取、寫入基本用法

C# 文字檔讀取、寫入基本用法

Google Chrome開發者工具教學 - Application

Google Chrome開發者工具教學 - Application

[Week 1] Command Line 入門 & 基本指令

[Week 1] Command Line 入門 & 基本指令






留言討論